{% extends "base.html" %}
{% load staticfiles %}
{% block title %}用户管理{% endblock %}
{% block css %}
	{% include "common/_stylesheets.html" %}
    <!-- Datatables -->
    <link href="{% static 'vendors/datatables.net-bs/css/dataTables.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css' %}" rel="stylesheet">
    <link href="{% static 'vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css' %}" rel="stylesheet">
{% endblock %}

{% block content %}
<div class="">
  <div class="page-title">
    <div class="title_left">
      <h3>用户管理<!-- <small> 用户基本信息管理 </small> --></h3>
    </div>
  </div>

  <div class="clearfix"></div>

  <div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
      <div class="x_panel">
        <div class="x_title">
           <h2>
          	  {% if user_type == '0' %}
          		未审核用户信息列表 
          	  {% elif user_type == '1' %}
          	  	审核通过用户信息列表
          	  {% else %}
          	  	审核未通过用户信息列表
          	  {% endif %}
          	</h2>
          <ul class="nav navbar-right">
	            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
	            </li>
	      </ul>
          <div class="clearfix"></div>
        </div>
        <div class="x_content">
          {% if request.session.usertype == 1 %}
          <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
            <thead>
              <tr>
                	<th>Id</th>
			  		<th>用户名</th>
			  		<th>邮箱</th>
			  		<th>手机</th>
			  		<th>用户状态</th>
			  		<th>创建时间</th>
			  		<th>更新时间</th>
			  		<th>操作</th>
              </tr>
            </thead>
            <tbody>
             		 {% for m in contacts %}  
					   	<tr>  
						     <td>  {{ m.id }}    </td> 
						     <td>  {{ m.username }}    </td> 
						     <td>  {{ m.email }}  </td>
						     <td>  {{ m.phone }}    </td>
						     <td>  {{ m.get_is_active_display }}    </td> 
						     <td>  {{ m.createTime }}    </td> 
						     <td>  {{ m.updateTime }}    </td>  
						     <td> 
						     	
						     	{% if m.is_active == 0  %}
								 	<a href="{% url 'check_user_pass' user_id=m.id page_num=contacts.number %}">
										审核通过
									</a> |
									 <a href="{% url 'check_user_nopass' user_id=m.id page_num=contacts.number %}">审核不通过</a> 
								{% elif m.is_active == 1 %}
								   <a href="{% url 'check_user_nopass' user_id=m.id page_num=contacts.number %}">审核不通过</a> 
								{% else %}
								   <a href="{% url 'check_user_pass' user_id=m.id page_num=contacts.number %}">
										审核通过
									</a>
								{% endif %}
							</td>  
					  	 </tr>  
				   {% endfor %}
            </tbody>
          </table>
          {% else %}
		  		权限不通过
		  {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}

{% block js %} 
	{% include "common/_js.html" %}
    <!-- Datatables -->
    <script src="{% static 'vendors/datatables.net/js/jquery.dataTables.min.js' %}"></script>
    <script src="{% static 'vendors/datatables.net-bs/js/dataTables.bootstrap.min.js' %}"></script>
    <script src="{% static 'vendors/datatables.net-responsive/js/dataTables.responsive.min.js' %}"></script>
    <script src="{% static 'vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js' %}"></script>
{% endblock %}
